package sapling.logic.object.cpu;

public class CPU {

	private static CPU cpu;

	private long controlRegister;
	private long generalRegister;
	private long pswRegister;
	private long sysStackPointer;
	private long usrStackPointer;

	private boolean busy;

	private CPU() {
		this.controlRegister = 0;
		this.generalRegister = 0;
		this.pswRegister = 0;
		this.sysStackPointer = 0;
		this.usrStackPointer = 0;
		this.busy = false;
	}

	public static CPU getInstance() {
		if (cpu == null) {
			cpu = new CPU();
		}
		return cpu;
	}

	public long getControlRegister() {
		return controlRegister;
	}

	public void setControlRegister(long controlRegister) {
		this.controlRegister = controlRegister;
	}

	public long getGeneralRegister() {
		return generalRegister;
	}

	public void setGeneralRegister(long generalRegister) {
		this.generalRegister = generalRegister;
	}

	public long getPswRegister() {
		return pswRegister;
	}

	public void setPswRegister(long pswRegister) {
		this.pswRegister = pswRegister;
	}

	public long getSysStackPointer() {
		return sysStackPointer;
	}

	public void setSysStackPointer(long sysStackPointer) {
		this.sysStackPointer = sysStackPointer;
	}

	public long getUsrStackPointer() {
		return usrStackPointer;
	}

	public void setUsrStackPointer(long usrStackPointer) {
		this.usrStackPointer = usrStackPointer;
	}

	public boolean isBusy() {
		return busy;
	}

	public void setBusy(boolean busy) {
		this.busy = busy;
	}
}